<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

Route::get('think', function () {
    return 'hello,ThinkPHP6!';
});
//Route::get('hello/:name', 'mobile/index/hello');


/*
 * 不走中间件
 */
Route::group('api/',function(){
    //登录
    /*Route::group('login',function(){
        Route::post('index','Login/index');
    });*/

    //上传文件
    Route::group('upload/', function (){
        Route::post('fileUpload','Upload/fileUpload'); //上传文件
    });
    //微信
    Route::group('wechat/', function (){
        Route::post('wechatLogin','Wechat/wechatLogin'); //微信登陆，获取openid，unionid，session_key
        Route::post('create_sign','Wechat/create_sign'); //生成签名；
        Route::post('add_user','Wechat/add_user'); //添加小程序登陆人员信息；
        Route::post('get_phone_number','Wechat/get_phone_number'); //获取微信用户手机号；
    });
    //字典列表
    Route::group('dictionary/', function (){
        Route::post('dictionaryList','Dictionary/dictionaryList'); //字典列表
    });

});

/*
 * 走中间件
 */
Route::group('api/',function(){


    //公告管理
    Route::group('notice/', function (){
        Route::post('noticeList','Notice/noticeList');//意见反馈列表；
        Route::post('noticeDtail','Notice/noticeDtail');//公告详情；
    });

    //意见反馈
    Route::group('opinion/', function (){
        Route::post('addOpinion','Opinion/addOpinion');//添加意见反馈
        Route::post('opinionList','Opinion/opinionList');//意见反馈列表；
    });
    

    /********************************去测评  开始******************************************/
    //题目
    Route::group('topic/', function (){
        Route::post('topicList','Topic/topicList');//题目列表
    });

    //答题
    Route::group('answer/', function (){
        Route::post('submitAnswer','Answer/submitAnswer');//提交答题
    });
    /********************************去测评  结束******************************************/


//});

})->middleware([
    \app\middleware\ApiMiddleware::class
]);